package org.dromara.germbank.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboReference;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.web.core.BaseController;
import org.dromara.germbank.domain.bo.DonorBasicBo;
import org.dromara.germbank.domain.vo.DonorBasicVO;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.dromara.profiles.api.service.RemoteDonorService;

/**
 * 捐赠者查询 controller
 *
 * @author congxing
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/donor")
public class BusDonorController extends BaseController {


    @RestController
    @RequestMapping("/donor/basic")
    public class DonorBasicController extends BaseController {

        // 1. 引用远程服务
        @DubboReference
        private RemoteDonorService donorBasicApi;

        /**
         * 查询捐赠者管理列表（支持分页）
         */
        @SaCheckPermission("donor:basic:list")
        @GetMapping("/list")
        public TableDataInfo<DonorBasicVO> list(DonorBasicBo bo, PageQuery pageQuery) {
            // 2. 直接把 bo + pageQuery 扔到远程，返回的就是 TableDataInfo
//            return donorBasicApi.selectPageList(bo, pageQuery);
            return null;
        }
    }
}
